package collection;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;

public class StreamDemo1 {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        Random random = new Random();
        for (int i = 0; i < 10; i++) {
            list.add(random.nextInt(100));
        }
        System.out.println(list);
        List<Integer> list1 = list.stream().map(e->e*3).collect(Collectors.toList());
        System.out.println(list1);
        List<Integer> list2 = list.stream().filter(e->e%2 == 0).map(e ->3).sorted().distinct().collect(Collectors.toList());
        System.out.println(list2);
    }

}
